package com.patterns.proxy.proxyPlayer;

/**
 * Created by Xiao Yiyun on 2017/4/23.
 * 实现了多个接口
 * 在目标对象方法的基础上作增强
 * 本质是对目标对象的方法进行拦截和过滤
 */
public class CountProxy implements IGamePlayer, IProxy {
    private IGamePlayer gamePlayer = null;
    public CountProxy(IGamePlayer gamePlayer) {
        this.gamePlayer = gamePlayer;
    }
    //代理登录
    public void login(String user, String pwd) {
        this.gamePlayer.login(user, pwd);
    }
    //代理打怪
    public void killBoss() {
        this.gamePlayer.killBoss();
    }
    //代理升级
    public void upGrade() {
        this.gamePlayer.upGrade();
    }
    //升级费用计算
    public void count() {
        System.out.println("升级总费用是：150元");
    }
}
